<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CommunityInteraction extends Model
{

    protected $fillable = [
        'user_id',
        'community_share_id',
        'interaction_type',
        'content'
    ];

    protected $casts = [
        'created_at' => 'datetime',
        'updated_at' => 'datetime'
    ];

    /**
     * 关联用户
     */
    public function user()
    {
        return $this->belongsTo(User::class);
    }

    /**
     * 关联社区分享
     */
    public function communityShare()
    {
        return $this->belongsTo(CommunityShare::class);
    }
}